package com.midou.administration.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.midou.administration.entity.Function;
import com.midou.administration.entity.Role;
import com.midou.administration.entity.RoleFunction;
import com.midou.administration.mapper.FunctionMapper;
import com.midou.administration.service.FunctionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author MrChen
 * @since 2021-03-24
 */
@Service
public class FunctionServiceImpl implements FunctionService {
    @Resource
    private FunctionMapper functionMapper;

    @Override
    public List<Function> queryFunction(List<RoleFunction> rfs) {
        return functionMapper.queryFunctionUrl(rfs);
    }

    @Override
    public Integer queryAllFunction(String path) {
        QueryWrapper qw = new QueryWrapper();
        qw.likeRight("fu_url",path);
        return functionMapper.selectCount(qw);
    }
    public List<Function> queryFunction(){
        QueryWrapper qw = new QueryWrapper();
        return functionMapper.selectList(qw);
    }
}
